home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / cowsay < prev    next >
Encoding:
Text File  |  2010-11-16  |  623 b   |  32 lines

  1. # bash completion for cowsay
  2.  
  3. have cowsay &&
  4. _cowsay()
  5. {
  6.     local cur prev
  7.  
  8.     COMPREPLY=()
  9.     _get_comp_words_by_ref cur prev
  10.  
  11.     case $prev in
  12.         -f)
  13.             COMPREPLY=( $( compgen -W '$( cowsay -l | tail -n +2)' -- "$cur" ) )
  14.             return 0
  15.             ;;
  16.     esac
  17.  
  18.     # relevant options completion
  19.     COMPREPLY=( $( compgen -W '-b -d -g -p -s -t -w -y -e -f -h -l -n -T -W' \
  20.         -- "$cur" ) )
  21.  
  22. } &&
  23. complete -F _cowsay -o default cowsay cowthink
  24.  
  25. # Local variables:
  26. # mode: shell-script
  27. # sh-basic-offset: 4
  28. # sh-indent-comment: t
  29. # indent-tabs-mode: nil
  30. # End:
  31. # ex: ts=4 sw=4 et filetype=sh
  32.